package com.loadmore.basic;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.loadmore.baselibrary.BaseActivity;

import java.util.Arrays;
import java.util.List;

public class MainActivity extends BaseActivity {

    private MainListAdapter adapter;
    private RecyclerView recyclerView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        recyclerView = (RecyclerView) findViewById(R.id.recyclerview);
        recyclerView.setLayoutManager(new LinearLayoutManager(context,LinearLayoutManager.VERTICAL,false));
        adapter = new MainListAdapter(context);
        recyclerView.setAdapter(adapter);
        initData();
    }

    public void initData() {
        String[] items = getResources().getStringArray(R.array.base_list);
        List<String> arrays = Arrays.asList(items);
        adapter.append(arrays);
    }
}
